/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.jeesite.modules.edu.entity;

import javax.validation.constraints.NotBlank;

import org.hibernate.validator.constraints.Length;

import com.jeesite.common.entity.BaseEntity;
import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.JoinTable;
import com.jeesite.common.mybatis.annotation.JoinTable.Type;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;
import com.jeesite.modules.sys.entity.Area;
import com.jeesite.modules.sys.entity.User;

/**
 * edu_teacher_stateEntity
 * @author 赵俊飞
 * @version 2019-07-23
 */
@Table(name="edu_teacher_state", alias="a", columns={
		@Column(name="teacher_code", attrName="teacherCode", label="公司编码", isPK=true),
		@Column(name="emp_code", attrName="user.userCode", label="用户编码"),
		@Column(name="state", attrName="state", label="操作状态"),
		@Column(name="title", attrName="title", label="操作主题", queryType=QueryType.LIKE),
		@Column(name="contact", attrName="contact", label="联系电话"),
		
		@Column(name="area_code", 		attrName="area.areaCode", 	label="区域编码"),
		@Column(includeEntity=DataEntity.class),
		@Column(includeEntity=BaseEntity.class),
	}, joinTable={
		@JoinTable(type=Type.LEFT_JOIN, entity=User.class, attrName="user", alias="u2",
			on="u2.user_code = a.emp_code", columns={
				@Column(name="user_code", label="用户编码", isPK=true),
				@Column(name="user_name", label="用户名称", isQuery=false),
		}),
		@JoinTable(type=Type.LEFT_JOIN, entity=Area.class, alias="b",
		on="b.area_code = a.area_code",
		columns={
				@Column(name="area_code", label="区域代码", isPK=true),
				@Column(name="area_name", label="区域名称", isQuery=false),
				@Column(name="area_type", label="区域类型"),
				@Column(name="tree_names", label="区域全称"),
	}),
	}, orderBy="a.update_date DESC"
)
public class EduTeacherState extends DataEntity<EduTeacherState> {
	
	private static final long serialVersionUID = 1L;
	private String teacherCode;		// 公司编码
	private User user;		// 用户编码
	private String state;		// 操作状态
	private String title;		// 操作主题
	private String contact;		// 联系电话
	private Area area;		// 区域编码
	
	public EduTeacherState() {
		this(null);
	}

	public EduTeacherState(String id){
		super(id);
	}
	
	public String getTeacherCode() {
		return teacherCode;
	}

	public void setTeacherCode(String teacherCode) {
		this.teacherCode = teacherCode;
	}
	

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	@Length(min=0, max=10, message="操作状态长度不能超过 10 个字符")
	public String getState() {
		return state;
	}

	public void setState(String state) {
		this.state = state;
	}
	
	@NotBlank(message="操作主题不能为空")
	@Length(min=0, max=500, message="操作主题长度不能超过 500 个字符")
	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}
	
	@Length(min=0, max=200, message="联系电话长度不能超过 200 个字符")
	public String getContact() {
		return contact;
	}

	public void setContact(String contact) {
		this.contact = contact;
	}

	public Area getArea() {
		return area;
	}

	public void setArea(Area area) {
		this.area = area;
	}

	@Override
	public String toString() {
		return "EduTeacherState [teacherCode=" + teacherCode + ", user=" + user + ", state=" + state + ", title="
				+ title + ", contact=" + contact + ", area=" + area + "]";
	}

	
}